<div class="page-header">
  <%= link_to new_user_path, :class => 'btn btn-primary' do %>
    <span class="glyphicon glyphicon-plus"></span>
    Nový uživatel
  <% end %>
  <h1>Seznam uživatelů</h1>
</div>

<div class="table-responsive">
  <table class="table table-striped table-bordered table-hover">
    <thead>
      <tr>
        <th>E-mail</th>
        <th>Login</th>
        <th>Jméno</th>
        <th>Příjmení</th>
        <th>Admin</th>
        <th>Poslední přihlášení</th>
        <th colspan="2">Akce</th>
      </tr>
    </thead>

    <tbody>
      <%= content_tag_for(:tr, @users) do |user| %>
        <td <%= 'style="font-weight:bold"'.html_safe if user.admin? %>><%= user.email %></td>
        <td><%= user.login %></td>
        <td><%= user.firstname %></td>
        <td><%= user.lastname %></td>
        <td><%= user.admin ? 'A' : '' %></td>
        <td><%= lf user.last_sign_in_at, :format=>'long' %></td>
        <td><%= link_to 'Upravit', edit_user_path(user) %></td>
        <td><%= link_to 'Heslo', {action: 'edit_password', id: user} %></td>
      <% end %>
    </tbody>
  </table>
</div>
